// pages/reserve/index.js
var val = [0, 0];

Page({

  /**
   * 页面的初始数据
   */
  data: {
    selectOne: true,
    selectTwo: false,

    years: ['今日', '5月30日星期三', '5月31日星期四', '6月1日星期五', '6月2日星期六', '6月3日星期日', '6月4日星期一'],
    pickerViewShow: false,
    value: [0, 0],
    array: ['8:00 - 9:00', '9:00 - 10:00', '10:00 - 11:00', '11:00 - 12:00', '12:00 -13:00', '13:00 -14:00', '14:00 - 15:00', '15:00 - 16:00', '16:00 - 17:00', '17:00 - 18:00', '18:00 - 19:00', '19:00 - 20:00', '20:00 - 21:00', '21:00 - 22:00'],
    startDate: false,

    date: '2018-05-19',
    index: 5,
    selectTeach: 1,
    address: 1
  },

  bindChange: function (e) {
    val = e.detail.value
  },

  onClick() {
    this.setData({
      pickerViewShow: true,
    })
  },

  pickerClear() {
    this.setData({
      pickerViewShow: false,
    })
  },

  pickerOk() {
    this.setData({
      pickerViewShow: false,
      value: val,
      startDate: true
    })
  },

  onAddressOne() {
    this.setData({
      address: 1
    })
  },

  onAddressTwo() {
    this.setData({
      address: 2
    })
  },
  onAddressThree() {
    this.setData({
      address: 3
    })
  },

  onMan() {
    this.setData({
      selectTeach: 1
    })
  },

  onWoman() {
    this.setData({
      selectTeach: 2
    })
  },

  onThree() {
    this.setData({
      selectTeach: 3
    })
  },

  onFour() {
    this.setData({
      selectTeach: 4
    })
  },
  onFive() {
    this.setData({
      selectTeach: 5
    })
  },

  startTap: function () {
    console.log("111")
    this.datetimePicker.setPicker('startDate');
  },

  bindPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value
    })
  },


  onSelectTwo() {
    let i = !this.data.selectTwo
    this.setData({
      selectTwo: true,
      selectOne: false,
    })
  },
  onSelectOne: function () {
    let i = !this.data.selectOne
    this.setData({
      selectTwo: false,
      selectOne: true,
    })
  },



  onReserve: function () {
    wx.navigateTo({
      url: '../sport/reserveInfo/reserveInfo',
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})